cmake_minimum_required(VERSION 3.4)
set(PROJ_NAME case16)
project(${PROJ_NAME})

add_executable(${PROJ_NAME}
    main.cpp
    )

add_custom_command(OUTPUT
    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/data/input.txt
    COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/data"
    COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/data/input.txt" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/data/input.txt"
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/data/input.txt"
    )

add_custom_target(DataFiles
    DEPENDS
    ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/data/input.txt
    COMMENT "Build DataFiles target"
    )

add_dependencies(${PROJ_NAME} DataFiles)
